package com.merchant.serviceimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.merchant.dao.MerchantDao;
import com.merchant.pojo.Merchant;
import com.merchant.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @ClassName: MerchantServiceImpl
 * @Description: TODO 商家数据访问业务逻辑接口实现类
 * @author zgg
 * @date 2021-05-07 14:15:37
 */
@Service
public class MerchantServiceImpl implements MerchantService {
 @Autowired
 MerchantDao merchantDao;
	@Override
	public boolean addMerchant(Merchant merchant) {
		
		return merchantDao.addMerchant(merchant)>0?true:false;
	}

	@Override
	public List<Merchant> findAll() {
		
		return merchantDao.findAll();
	}

	@Override
	public Merchant findById(int mid) {
		
		return merchantDao.findById(mid);
	}

	@Override
	public boolean deleteMerchant(int[] ids) {
		
		return merchantDao.deleteMerchant(ids)>0?true:false;
	}

	@Override
	public boolean updateMerchant(Merchant merchant) {
		
		return merchantDao.updateMerchant(merchant)>0?true:false;
	}

}
